package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.OrdersPageQueryDTO;
import com.sky.entity.Orders;
import com.sky.vo.OrderVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.core.annotation.Order;

@Mapper
public interface OrderMapper {

    Page<OrderVO> page(OrdersPageQueryDTO ordersPageQueryDTO);

    @Select("select count(id) from orders where status = 2")
    Integer toBeConfirmed();

    @Select("select count(id) from orders where status = 4")
    Integer deliveryInProgress();


    @Select("select count(id) from orders where status = 3")
    Integer confirmed();


    @Select("select * from orders where id = #{id}")
    Orders getById(Long id);
}
